﻿using System;
using DomainModel;
using Services.Abstract;

namespace Services.Concrete
{
    public class RoleService : IRoleService
    {
        public Role GetRoleByName(string role)
        {
            switch (role)
            {
                case "Admin":
                    return Role.Admin;
                case "Parent":
                    return Role.Parent;
                case "Student":
                    return Role.Student;
                case "Teacher":
                    return Role.Teacher;
                case "TrainingDivisionWorker":
                    return Role.TrainingDivisionWorker;
                default:
                    throw new Exception("Invalid role.");
            }
        }

        public string GetRoleName(Role role)
        {
            switch (role)
            {
                case Role.Admin:
                    return "Админ";
                case Role.Parent:
                    return "Родитель";
                case Role.Student:
                    return "Студент";
                case Role.Teacher:
                    return "Преподаватель";
                case Role.TrainingDivisionWorker:
                    return "Работник учебного отдела";
                default:
                    return "Неизвестно";
            }
        }
    }
}